SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_GetTabByName]

@TabName  nvarchar(50),
@PortalID int

as
SELECT *
FROM   dbo.DnnProduct_vw_Tabs
where  TabName = @TabName
and    ((PortalId = @PortalID) or (@PortalID is null AND PortalId is null))
order by TabID


GO
